﻿@model AzureGames.Domain.Models.GameBoard
@{
    ViewBag.Title = "Play";    
}

@if (Request.IsAuthenticated)
{
<script type="text/javascript">
    GameBoard =
            {
                GameID: '@Model.ID',
                BoardJSON: '@Html.Raw(Model.GameState)',
                UserID: '@(((AzureGames.Model.User)Session["User"]).ID)'
            };
</script>
}
else
{
    <script type="text/javascript">
        GameBoard =
            {
                GameID: '@Model.ID',
                BoardJSON: '@Html.Raw(Model.GameState)',
                UserID: '00000000-0000-0000-0000-000000000000'
            };
</script>
}
<div id="game-content">
 <div id="play-content" class="article framed" >
@Html.Raw(Model.HTML)
</div>
</div>
@foreach (Guid cssFile in Model.CSSFiles)
{
    <link href="@Url.Action("GetResource", new { resourceID = @cssFile, contentType = "text/css" })" rel="stylesheet" type="text/css" />
}
@foreach (Guid jsFile in Model.JavascriptFiles)
{
            <script type="text/javascript" src='@Url.Action("GetResource", new { resourceID = @jsFile, contentType = "text/javascript" })'></script>
}